package com.xzq.erp.constants;

import java.time.Duration;

public interface JwtConstants {

    public static final String PAYLOAD_USERID_KEY = "userId";
    public static final String PAYLOAD_JTI_KEY = "jti";

    public static final String JWT_REDIS_KEY_PREFIX = "jwt:uid:";
    // token过期时间，测试期间改为 1天，正常是5分钟
    public static final Duration JWT_TOKEN_TTL = Duration.ofMinutes(1);
    public static final Duration JWT_REFRESH_TTL = Duration.ofMinutes(30);

    public static final Duration JWT_REMEMBER_ME_TTL = Duration.ofDays(7);

    public static final String JWT_ALGORITHM = "rs256";
    public static final String AUTHORIZATION_HEADER = "Authorization";
    public static final String TOKEN_PREFIX = "Bearer ";
    public static final String REFRESH_HEADER = "refresh";

}